// File: delay_us.h
#ifndef __DELAY_US_H
#define __DELAY_US_H

#ifdef __cplusplus
extern "C" {
#endif

#include "stm32f4xx_hal.h"

// DWT寄存器宏定义
#define DWT_CTRL_REG   (*(volatile uint32_t *)0xE0001000)
#define DWT_CYCCNT_REG (*(volatile uint32_t *)0xE0001004)
#define DEMCR_REG      (*(volatile uint32_t *)0xE000EDFC)

void HAL_DelayUs_Init(void);
void HAL_DelayUs(uint32_t microseconds);

#ifdef __cplusplus
}
#endif

#endif /* __DELAY_US_H */